<?php
// Check crossing acess
	if (!defined('RIGHT_ACCESS') || !defined('ROOT_FOLDER'))
	{
		header('Content-Type: text/xml; charset=utf-8');
		echo '<?xml version="1.0"?>';
		echo '<atomtask>';
		echo '<request>error.request.invalid</request>';
		echo '</atomtask>';
		return;
	}	
	class XML
	{
		public static $stack;
		public static function start()
		{
			header('Content-Type: application/xml; charset=utf-8');
			echo '<?xml version="1.0" encoding="UTF-8"?>';
			echo '<atomtask>';
			XML::$stack = array();
		}
		public static function end()
		{
			echo '</atomtask>';
		}
		public static function start_element($element)
		{
			echo '<'.$element.'>';
			array_push(XML::$stack, $element);
		}
		public static function write_value($value)
		{
			echo $value;
		}
		public static function end_element()
		{
			$element = array_pop(XML::$stack);
			echo '</'.$element.'>';
		}
		public static function write_element($element, $value)
		{
			echo '<'.$element.'>'.$value.'</'.$element.'>';
		}
	}
?>